/**
 * Printing formatted data
 * 
 * @author Amrita Mukherjee
 * @version 11/1/12
 */
public class A20_2
{
   public static void main(String[] args)
    {
        String item1 = "Carrot";
        String item2 = "Banana";
        String item3 = "Apple";
        
        int quantity1 = 5;
        int quantity2 = 10;
        int quantity3 = 7;
        
        double price1 = 0.23;
        double price2 = 1.65;
        double price3 = 2.5;
        
        System.out.printf("%-6s quantity:%2d price:$%4.2f\n", item1, quantity1, price1);
        System.out.printf("%-6s quantity:%2d price:$%4.2f\n", item2, quantity2, price2);
        System.out.printf("%-6s quantity:%2d price:$%4.2f\n", item3, quantity3, price3);
    }

}
/* my tese session:
Carrot quantity: 5 price:$0.23
Banana quantity:10 price:$1.65
Apple  quantity: 7 price:$2.50

 */